<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>剑灵官方网站-腾讯游戏</title>
    <link rel="stylesheet" href="index.css"/>
    <link rel="shortcut icon" href="favicon.ico"/>
</head>
<body>
    <!--topBanner顶部通栏-->
    <div class="topBanner" id="topBanner">
        <ul>
            <li><a href="#"><div class="blank"></div></a></li>
            <li><a href="#"><div class="Tencent"></div></a></li>
            <li><a href="#"><div class="february"></div></a></li>
            <li>
                <div class="top-right fl">
                    <span class="downLoad"><a href="#">游戏下载</a></span>
                    <span class="money"><a href="#">点券充值</a></span>
                    <div class="backbg fr"><a href="#"><span class="back">返回官网首页</span></a></div>
                </div>
            </li>
        </ul>
    </div>
    <!--topx顶部导航栏-->
    <div class="topIndex" id="topIndex">
        <ul>
            <li><div class="bg"></div></li>
            <li><a href="#"><div class="name" id="name"></div></a></li>
            <li><a href="../../BNS.html"><div class="enter"></div></a></li>
            <li><a href="#"><div class="load"></div></a></li>
            <li><a href="#"><div class="loadTools"></div></a></li>
            <li><a href="#"><div class="appFast"></div></a></li>
            <li><a href="#"><div class="app"></div></a></li>
            <li><a href="#"><div class="load17173"></div></a></li>
            <li><a href="#"><div class="otherLoad"></div></a></li>
        </ul>
    </div>
    <!--background背景栏-->
    <div class="banner" id="banner">
        <!--<a href="javascript：void()"></a>-->
    </div>
    <!--girls主图-->
    <div class="girls w">
        <div class="girls_img">
            <a href="#"><img src="images/wrap_bg1 (2).jpg" alt=""/></a>
        </div>

        <div class="smallLink">
            <div class="smallLink-left fl">
                <ul>
                    <li><div class="clothes"></div></li>
                    <li><div class="white"></div></li>
                </ul>
            </div>
            <div class="smallLink-right-outer fl" id="smallLink-right-outer">
                <div class="smallLink-right-inner" id="smallLink-right-inner">
                    <ul>
                        <li><div class="lb1"></div></li>
                        <li><div class="lb2"></div></li>
                        <li><div class="lb3"></div></li>
                        <li><div class="lb4"></div></li>
                        <li><div class="lb5"></div></li>
                    </ul>
                    <ol></ol>
                </div>
            </div>
        </div>
    </div>
    <!--hospital剑灵诊所-->
    <div class="hospital">
        <div class="w">
            <h2>剑灵诊所</h2>
            <p class="p1">为您解决客户端报错、闪退、延迟、卡机等问题，助您流畅运行剑灵</p>
            <div class="boxLeft fl">
                <div class="boxLeft-top">
                    <p class="p2">为您解决客户端进入游戏解决</p>&nbsp;&nbsp;<span>延迟高，掉线，</span>
                    <p class="p3">登陆时报错（200、300、1000、2000、3000）</p>
                </div>
                <div class="boxLeft-bottom">
                    <input type="button" value="TGP(剑灵专用免费加速)"/>
                    <input type="button" value="QQ会员加速小助手"/>
                    <input type="button" value="剑灵定制迅游加速器"/>
                </div>
            </div>
            <div class="boxRight fl">
                <div class="boxRight-top">
                    <p class="p2">安装客户端时，请务必&nbsp;&nbsp;<span>安装DXSETUP及vcredist_x86两个组件</span>，否则可能造成无法进入游戏或者客户端崩溃等问题。</p>
                </div>
                <div class="boxRight-bottom">
                    <input type="button" value="DirectX"/>
                    <input type="button" value="Microsoft visual C++"/>
                    <input type="button" value="报错修复"/>
                    <button>Nvidia显卡驱动 <br/><span>64位(推荐)</span></button>
                    <button>Nvidia显卡驱动 <br/><span>32位(建议升级)</span></button>
                </div>
            </div>
        </div>
    </div>
    <!--suggest配置推荐-->
    <div class="suggest" id="suggest">
        <div class="w">
            <div class="title">
                <p class="p1">配置要求以及推荐</p>
                <p class="p2">为了体验到剑灵的真正魅力，享受华丽的视觉盛宴，建议您使用推荐硬件配置和Win7 64位系统来进行游戏</p>
            </div>
            <div class="box" id="box">
                <div class="tab" id="tab">
                    <span>3档流畅</span>
                    <span>4档</span>
                    <span  class="current">5档（推荐）</span>
                    <span>Ultra（顶级）</span>
                </div>
                <div class="suggest-texts">
                    <ul>
                        <li>
                            <div>CPU</div><span>推荐第四代智能英特尔酷睿i3处理器</span><br/>
                            <div>内存</div><span>4GB及以上</span><br/>
                            <div>显卡</div><span>GeForce GT 640 D5 , GT 640M(笔记本)</span><br/>
                            <div>硬盘</div><span>7200转机械硬盘</span><br/>
                            <div>系统</div><span>Windows 7(64位) DirectX 9.0C</span><br/>
                            <div>屏幕分辨率</div><span>1440X900</span><br/>
                        </li>
                        <li>
                            <div>CPU</div><span>推荐第四代智能英特尔酷睿i5处理器</span><br/>
                            <div>内存</div><span>4GB及以上</span><br/>
                            <div>显卡</div><span>GeForce GTX 650 , GTX 750M(笔记本)</span><br/>
                            <div>硬盘</div><span>7200转机械硬盘</span><br/>
                            <div>系统</div><span>Windows 7(64位) DirectX 9.0C</span><br/>
                            <div>屏幕分辨率</div><span>1920X1080</span><br/>
                        </li>
                        <li class="current">
                            <div>CPU</div><span>推荐第四代智能英特尔酷睿i7处理器</span><br/>
                            <div>内存</div><span>4GB及以上</span><br/>
                            <div>显卡</div><span>GeForce GTX 750 , GTX 750 Ti , GTX 760M(笔记本)<br/>GTX 765M</span><br/>
                            <div>硬盘</div><span>7200转机械硬盘 , SSD(固态硬盘)</span><br/>
                            <div>系统</div><span>Windows 7(64位) DirectX 9.0C</span><br/>
                            <div>屏幕分辨率</div><span>1920X1080</span><br/>
                        </li>
                        <li>
                            <div>CPU</div><span>推荐第四代智能英特尔酷睿i7-4770K处理器</span><br/>
                            <div>内存</div><span>8GB及以上</span><br/>
                            <div>显卡</div><span>GeForce GTX 660 , GeForce GTX 760 , GTX 770<br>GTX 680M , GTX 780M</span><br/>
                            <div>硬盘</div><span>7200转机械硬盘 , SSD(固态硬盘)</span><br/>
                            <div>系统</div><span>Windows 7(64位) DirectX 9.0C</span><br/>
                            <div>屏幕分辨率</div><span>2560x1600</span><br/>
                        </li>
                    </ul>
                    <div class="picture"></div>
                </div>
            </div>
        </div>
    </div>
    <!--footer底部栏-->
    <div class="footer">
        <div class="w">
            <div class="message">
                <p class="message1"><a href="#">腾讯互动娱乐</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="#">服务条款</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a
                        href="#">广告服务</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="#">腾讯游戏招聘</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a
                        href="#">腾讯游戏客服</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="#">游戏地图</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a
                        href="#">游戏活动</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="#">商务合作</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a
                        href="#">网站导航</a></p>
                <p class="message2">COPYRIGHT © 1998 – 2017 TENCENT. ALL RIGHTS RESERVED.</p>
                <p class="message3">腾讯公司 版权所有</p>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script>
    var topIndex = document.getElementById("topIndex");
    window.onscroll= function () {
        if(window.pageYOffset>174){
            topIndex.style.position="fixed";
            topIndex.style.top=0;
        }else if(window.pageYOffset<42){
            topIndex.style.position="";
        }
    }





//    轮播图

        //    获取事件源
        var outer = document.getElementById("smallLink-right-outer");
        var inner = document.getElementById("smallLink-right-inner");
        var ul = inner.children[0];
        var ulLiArr = ul.children;
        var ol = inner.children[1];
        var olLiArr = ol.children;
        var imgWidth = inner.offsetWidth;

        //    事件处理程序
        //    复制第一张图片，并添加到图片列表末尾
        var newLi = ulLiArr[0].cloneNode(true);
        ul.appendChild(newLi);
        //    创建方块索引，索引值与图片张数同步，并为索引赋值
        for (var i = 0; i < ulLiArr.length - 1; i++) {
            newLi = document.createElement("li");
            newLi.innerHTML = i + 1;
            ol.appendChild(newLi);
        }

        //    定义两个计数器：小方块一个，图片一个
        var square = 0;
        var key = 0;

        //    滑动轮播图部分
        for (var i = 0; i < olLiArr.length; i++) {
            //        当鼠标移动到索引方块时触发事件
            olLiArr[i].onmouseover = function () {
                //        调用匀速动画方法: ele中传递ul中的图片，target传递距离
                fn(ul, -imgWidth * (this.innerHTML - 1));
            }
        }

        //    设置图片向右定时轮播
        var timer = setInterval(autoPlay, 2000);

        function autoPlay() {
            //        计数器自加移动到下一张
            square++;
            key++;
            if (square == olLiArr.length) {
                square = 0;
            }
            if (key == ulLiArr.length) {
                ul.style.left = 0;
                key = 1;
            }
            //        调用匀速动画方法
            fn(ul, -imgWidth * (key));
        }

        //    设置鼠标移入时候停止自动轮播
        outer.onmouseover = function () {
            clearInterval(timer);
        }
        //    设置鼠标移入时候开始自动轮播
        outer.onmouseout = function () {
            timer = setInterval(autoPlay, 2000);

        }
        //    将匀速动画封装为方法,ele传递盒子参数，target传递移动参数
        function fn(ele, target) {
            //        要用定时器，先清除定时器
            clearInterval(ele.timer);
            //        设置定时器，并且将定时器与盒子同步
            ele.timer = setInterval(function () {
                //        设置步长:当目标位置在盒子左边时候，步长取-10，当在右边时候，步长取10
                var step = target > ele.offsetLeft ? 10 : -10;
                //            动画原理：盒子目标位置 = 盒子所在位置 + 步长
                ele.style.left = ele.offsetLeft + step + "px";
                //            当盒子左边距距离 = 移动距离，清除定时器，动画停止;如果判断到步长不足，就将步长的值直接赋给盒子的左边距
                if (Math.abs(target - ele.offsetLeft) <= Math.abs(step)) {
                    ele.style.left = target + "px";
                    clearInterval(ele.timer);
                }
            }, 10);
        }

//    多任务栏切换

        var box = document.getElementById("box");
        var tabs = document.getElementById("tab");
        var spans = tabs.getElementsByTagName("span");
        var lis = box.getElementsByTagName("li");

        for (var i = 0; i < spans.length; i++) {  // 这层循环的用处是给每一个span标签注册事件
            spans[i].setAttribute("index", i); // 给每一个Span标签设置自定义属性
            spans[i].onclick = function () {
                for (var j = 0; j < spans.length; j++) { // 清空所有的span标签的class属性
                    spans[j].removeAttribute("class");
                    lis[j].removeAttribute("class");
                }
                this.setAttribute("class", "current");
                var index = this.getAttribute("index");
                lis[index].setAttribute("class", "current");
                console.log(1);
            }
        }

</script>